package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/hr/pb"

	"google.golang.org/grpc"
)

var Roles roles

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_HR, func(c *grpc.ClientConn) { Roles.cli = gpb.NewRolesClient(c) })
}

type roles struct {
	cli gpb.RolesClient
}

// roles.GetRoleList 获取角色列表
func (this *roles) GetRoleList(ctx context.Context, in *gpb.RolesBaseReq) (*gpb.GetRolesRes, error) {
	return this.cli.GetRoleList(ctx, in)
}

// roles.AddRole 添加角色
func (this *roles) AddRole(ctx context.Context, in *gpb.RolesBaseReq) (*gpb.RolesBaseRes, error) {
	return this.cli.AddRole(ctx, in)
}

// roles.DelRole 删除角色
func (this *roles) DelRole(ctx context.Context, in *gpb.RolesBaseReq) (*gpb.RolesBaseRes, error) {
	return this.cli.DelRole(ctx, in)
}

// roles.GetRole 获取单个角色
func (this *roles) GetRole(ctx context.Context, in *gpb.RolesBaseReq) (*gpb.RolesBaseRes, error) {
	return this.cli.GetRole(ctx, in)
}
